﻿using System;
using System.Collections.Generic;

namespace HYRElectric.LightningCalculation
{
	public class CalculationData
	{
		public bool IsFormulaMethod { get; set; }

		public double BuildingLength { get; set; }

		public double BuildingWidth { get; set; }

		public double BuildingHeight { get; set; }

		public double Td { get; set; }

		public double K { get; set; }

		public EnvironmentalFactors BuildingEnvironmentalFactors { get; set; }

		public double Ae { get; set; }

		public List<string> AeCalculateFormulaDetailed { get; set; }

		public double Ng { get; set; }

		public double N { get; set; }

		public string BuildingParamter { get; set; }

		public string ProtectionCategory { get; set; }

		public CalculationData()
		{
		}

		public CalculationData(CalculationData info)
		{
			this.IsFormulaMethod = info.IsFormulaMethod;
			this.BuildingLength = info.BuildingLength;
			this.BuildingWidth = info.BuildingWidth;
			this.BuildingHeight = info.BuildingHeight;
			this.Td = info.Td;
			this.K = info.K;
			this.BuildingEnvironmentalFactors = info.BuildingEnvironmentalFactors;
			this.Ae = info.Ae;
			this.AeCalculateFormulaDetailed = info.AeCalculateFormulaDetailed;
			this.Ng = info.Ng;
			this.N = info.N;
			this.BuildingParamter = info.BuildingParamter;
			this.ProtectionCategory = info.ProtectionCategory;
		}

		public string GetBuildingEnvironmentalFactors()
		{
			string result = "周边建筑高于当前建筑";
			if (this.BuildingEnvironmentalFactors == EnvironmentalFactors.EF_Without)
			{
				result = "不考虑周边建筑";
			}
			else if (this.BuildingEnvironmentalFactors == EnvironmentalFactors.EF_LowerThanOrEqual)
			{
				result = "周边建筑等高或低于当前建筑";
			}
			return result;
		}
	}
}
